/*
 * GamePanel.fx
 *
 * Created on Apr 26, 2009, 5:45:50 PM
 */

package com.dg.gaming.client.fx.gui;

import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import Window.JDLayout.DigLayout;
import Window.JDLayout.Item;
import Window.JDLayout.Row;

/**
 * @author dito
 */

public class GamePanel extends CustomNode {
    public var mainframe:FXMain;
    var cahtUsers=ChatUsers{mainframe:mainframe};
    var controlPanel=ControlPanel{mainframe:mainframe};
     var gameBoard=GameBoard{};
     var group=Group{
            content: [
                        javafx.ext.swing.SwingLabel {
							text: "DigLayout Docking..easy!"
							font: javafx.scene.text.Font {
						        size: 24
						    },
						}
            ]
        };
    var contentPane = DigLayout{

	//internalstroke: javafx.scene.paint.Color.GRAY

	// Set columns and rows size
	// e:xxx -> are empty cols or empty columns
	columns:["80%","20%"]
	rows:["13","100%"]

	// No resize with window
	fixed:false
	percentualFlag:true

	margin:0

	digrows:[
		Row{
			items:[
				Item{
					valign:"top"
					halign:"left"
					colspan:2
					item: controlPanel
				}
			]
		},
		Row{
			items:[
				Item{
					valign:"middle"
					halign:"center"
			    	fill: javafx.scene.paint.LinearGradient {
				      startX: 0.0, startY: 0.0, endX: 1.0, endY: 1.0, proportional: true

				      stops: [
				        javafx.scene.paint.Stop {offset: 0.0 color: javafx.scene.paint.Color.web("#fffacd")},
				        javafx.scene.paint.Stop {offset: 1.0 color: javafx.scene.paint.Color.web("#ffffff")}
				      ]
				    }
					item:group

				},
				Item{
					valign:"top"

					item:[

                            ChatUsers{}


                    ]
				},
			]
		}
	]
};


    

    

     public function setGamePanel(panel:CustomNode){
         group.content=[];
         insert panel into group.content;
     }


    public override  function create():Node {
        return contentPane;
    }
     public function setUp(mainframe:FXMain){
         this.mainframe=mainframe;
         controlPanel.setUp(mainframe);
     }

}
